import { Module } from './module.entity'
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from 'typeorm'
import { ModulePlugin } from './module-plugin.entity'

@Entity()
export class ModuleRight {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  title: string

  @Column()
  code: string

  @Column()
  url: string

  @ManyToOne(type => Module, module => module.rights)
  module: Module

  @ManyToOne(type => ModulePlugin, plugin => plugin.rights)
  plugin: ModulePlugin
}
